package prgechecsmodel;

import java.util.TreeSet;

public interface IBoard {

    /**
     * Returns the shortest distance between two squares
     */
    int distance(int squareA, int squareB);

    void genPromote(TreeSet<IMove> ret, int from, int to, int bits);

    void genPush(TreeSet<IMove> ret, int from, int to, int bits);

    int gen_allLegalMoves(TreeSet<IMove> moves, int startIndex);

    int gen_allLegalMoves(int[] moves, int i);

    TreeSet<IMove> genCaps();

    TreeSet<IMove> gen();

    boolean validate(int move);

    /**
     * Takes an index and checks if the index can be attacked by 'side'
     * The side that is attacking (white: 1, black: -1)
     * @return boolean True it can be attacked, false it can't
     */
    boolean isAttacked(int attacked, int side);

    int reps();

    /**
     * Makes a Move on the board and updates the zobrist key accordingly
     * @param Move move
     */
    boolean makeMove(IMove m);

    public void makeMove(int i);

    int rank(int index);

    int col(int x);

    /**
     * Sets the board to the starting position
     * rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
     */
    void setupStart();

    /**
     * Unmakes a Move on the board
     * @param Movemove
     */
    void unmakeMove(int move);

    void takeBack();

    int getColor(int i, int j);

    int getPiece(int i, int j);

    boolean inCheck(int s);

    boolean isWhiteToMove();

    /**
     * Returns the current position in FEN-notation
     * @return A string with FEN-notation
     */
    String getFen();

    /**
     * Takes a FEN-string and sets the board accordingly
     * @param String fen
     */
    void inputFen(String fen);

    @Override
    String toString();
}
